
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="aoP4Lg2AzJwMF6BAIFLtmg3fZaRdutzCNMr97fIu">

    <title>首页 - Laravel Album</title>

    <!-- 加载 CSS -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet">
     <link href="/xaingce/css/app.css" rel="stylesheet">

      <!-- 加载 js -->
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
    <script src="https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js"></script>
    <script src="https://cdn.bootcss.com/jquery.imagesloaded/4.0.0/imagesloaded.pkgd.min.js"></script>
</head>
<body>

    <!-- bootstrap 导航条 -->
    <nav class="navbar navbar-default">
      <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <!-- LOGO 首页跳转按钮 -->
          <a class="navbar-brand" href="http://l.com/albums">作业_公共模块_相册</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
          <ul class="nav navbar-nav">
            <!-- 导航按钮 此网站不需要 -->
            <!-- <li><a href="#">Link</a></li> -->
          </ul>
        </div>
      </div>
    </nav>

    <!-- bootstrap 容器 -->
    <div class="container">
        <!-- 显示提示消息 -->
                <!-- 网站主体内容 -->
        
<!-- 错误信息 -->

<!-- 创建相册：弹出框按钮 -->
<button type="button" class="btn btn-primary" style="margin-bottom:10px" data-toggle="modal" data-target="#createAlbum">
创建相册
</button>


<!-- 创建相册：弹出框 -->
<div class="modal fade" id="createAlbum" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">创建相册</h4>
      </div>
      <div class="modal-body">
          <form class="form-horizontal" action="/xiangce/create" method="post"  enctype="multipart/form-data">
            <input type="hidden" name="_token" value="aoP4Lg2AzJwMF6BAIFLtmg3fZaRdutzCNMr97fIu">

            <div class="form-group">
              <label for="name" class="col-sm-2 control-label">选择图片</label>
              <div class="col-sm-10">
                <input type="file" name="path" required>
              </div>
            </div>
            {{csrf_field()}}
            <div class="form-group">
              <label for="name" class="col-sm-2 control-label">相册名称</label>
              <div class="col-sm-10">
                <input type="text" class="form-control" id="name" name="name" required>
              </div>
            </div>
            <div class="form-group">
              <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary">创建</button>
              </div>
            </div>
          </form>
      </div>
    </div>
  </div>
</div>
<div></div>
<!-- 相册展示 -->

<div class="row masonry">
@foreach($albums as $v)
  <div class="col-md-3 col-sm-4 col-xs-6 album  item">


        <div class="panel panel-default">
          <div class="panel-body">
                            <img class="img-responsive" src="{{$v->path}}">
                        <p class="album-name">{{$v->name}}</p>
                      </div>
        </div>


</div>
@endforeach
</div>


<!--瀑布流-->
<script>
 var container = $('.masonry');
  container.imagesLoaded(function() {
    container.masonry({
    itemSelector: '.item',
    isAnimated: true,
    });
});
</script>
     </div>

   
</body>
</html>
